package com.hbnu.dao;

import javax.annotation.Resource;


public class UserDao {
   @Resource(name = "userDao")
   private UserDao userDao;

    public void  print(){
        System.out.println("我是userDao");
    }


    public void lessMoney(String name,Double money){
        String sql="update tb_user set salary =salary-?where name =?";
        int row=jdcTemplate.update(sql,money,name);
        System.out.println(row==1?"转账成功":"收款失败");
    }

    public void moreMoney(String name,Double money){
        String sql="update tb_user set salary =salary＋?where name =?";
        int row=jdcTemplate.update(sql,money,name);
        System.out.println(row==1?"收款成功":"收款失败");

    }
}
